Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds an AudiencePolicy to the Azure App Configuration SDK for Java to provide more user-friendly error messages when Azure Active Directory audience-related authentication failures occur, particularly in non-public Azure clouds (such as Azure China or Azure Government). The policy intercepts HTTP responses containing the AAD error code "AADSTS500011" and replaces the error message with clearer guidance based on whether an audience was configured or not.
Key Changes
- Added
AudiencePolicyclass that implementsHttpPipelinePolicyto detect and transform audience-related authentication errors - Integrated the policy into the HTTP pipeline in
ConfigurationClientBuilder - Added comprehensive unit tests covering both sync and async scenarios
- Updated CHANGELOG to document the new feature
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/implementation/AudiencePolicy.java | New policy class that intercepts AAD audience errors and provides clearer error messages based on whether an audience was configured |
| sdk/appconfiguration/azure-data-appconfiguration/src/main/java/com/azure/data/appconfiguration/ConfigurationClientBuilder.java | Integrates AudiencePolicy into the HTTP pipeline before retry policies |
| sdk/appconfiguration/azure-data-appconfiguration/src/test/java/com/azure/data/appconfiguration/implementation/AudiencePolicyTest.java | Comprehensive test coverage for the new policy including sync/async scenarios, error transformation, and edge cases |
| sdk/appconfiguration/azure-data-appconfiguration/CHANGELOG.md | Documents the new audience policy feature for better error messaging |
...pconfiguration/src/main/java/com/azure/data/appconfiguration/ConfigurationClientBuilder.java
Outdated
Show resolved
Hide resolved
...pconfiguration/src/main/java/com/azure/data/appconfiguration/ConfigurationClientBuilder.java
Outdated
Show resolved
Hide resolved
...uration/src/test/java/com/azure/data/appconfiguration/implementation/AudiencePolicyTest.java
Show resolved
Hide resolved
...nfiguration/src/main/java/com/azure/data/appconfiguration/implementation/AudiencePolicy.java
Show resolved
Hide resolved
…/com/azure/data/appconfiguration/ConfigurationClientBuilder.java Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
alzimmermsft
approved these changes
Nov 10, 2025
alzimmermsft
approved these changes
Nov 19, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds an Audience Policy to give a better error message on Audience failures in clouds such as Bleu.
All SDK Contribution checklist:
General Guidelines and Best Practices
Testing Guidelines